package fon.rm2.server;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTabbedPane;
import java.awt.Color;
import java.awt.Button;
import java.awt.TextArea;
import java.awt.Label;
import java.awt.Checkbox;
import java.awt.TextField;

public class MainServerFrame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1420176728381788156L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainServerFrame frame = new MainServerFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainServerFrame() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 626, 483);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));
		
		JTabbedPane mainTabPane = new JTabbedPane(JTabbedPane.TOP);
		contentPane.add(mainTabPane);
		
		JPanel tabServerControl = new JPanel();
		mainTabPane.addTab("Server Control", null, tabServerControl, null);
		tabServerControl.setLayout(null);
		
		TextArea txtServerTraffic = new TextArea();
		txtServerTraffic.setEditable(false);
		txtServerTraffic.setBounds(10, 140, 565, 257);
		tabServerControl.add(txtServerTraffic);
		
		Button btnToggleServer = new Button("Toggle Server");
		btnToggleServer.setBounds(213, 31, 170, 46);
		tabServerControl.add(btnToggleServer);
		
		Label label = new Label("Server OFF");
		label.setBackground(Color.RED);
		label.setAlignment(Label.CENTER);
		label.setBounds(405, 31, 108, 46);
		tabServerControl.add(label);
		
		Checkbox chkServerTraffic = new Checkbox("Server Traffic");
		chkServerTraffic.setBounds(8, 112, 95, 22);
		tabServerControl.add(chkServerTraffic);
		
		Label label_1 = new Label("Server port:");
		label_1.setBounds(24, 39, 62, 22);
		tabServerControl.add(label_1);
		
		TextField txtServerPort = new TextField();
		txtServerPort.setBounds(91, 39, 95, 22);
		tabServerControl.add(txtServerPort);
		
		Checkbox chkEcho = new Checkbox("Echo");
		chkEcho.setBounds(213, 83, 95, 22);
		tabServerControl.add(chkEcho);
		
		
		JPanel panel_1 = new JPanel();
		mainTabPane.addTab("New tab", null, panel_1, null);
	}
}
